]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Handle reordering of workspaces
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 8 Oct 2019 18:27:34 +0000 (20:27 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 8 Oct 2019 19:11:19 +0000 (21:11 +0200)
MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1497

js/ui/windowManager.js

index 11837c46a7b0a42163d5afc628c0c85cb65e2302..ff2f089645ff231ae02a3757b4cffd6f60c414cf 100644 (file)
@@ -187,6 +187,9 @@ var WorkspaceTracker = class {
         let workspaceManager = global.workspace_manager;
         workspaceManager.connect('notify::n-workspaces',
                                  this._nWorkspacesChanged.bind(this));
+        workspaceManager.connect('workspaces-reordered', () => {
+            this._workspaces.sort((a, b) => a.index() - b.index());
+        });
         global.window_manager.connect('switch-workspace',
                                       this._queueCheckWorkspaces.bind(this));